<?php
/**
 * @file
 * Displays a filter for the selection of deeds.
 *
 * Usage:
 *  - A page that wants to display a filter for the selection of deeds should
 *    include/require this page.
 *
 * Parameter(s):
 *  - None.
 *
 * Global variable(s) set:
 *  - None.
 *
 * Global variable(s) unset:
 *  - None.
 *
 * Exception(s):
 *  - None.
 *
 * This file includes/requires:
 *  - h_greenindeed.php
 *  - h_filter.php
 *  - h_jqui.php
 */

// header file(s) ==============================================================
require_once "h_greenindeed.php";
require_once "h_filter.php";
require_once $PATH_COMMON . "php/h_jqui.php";

// implementation ==============================================================
?>
<form name="<?php echo NAME_FILTER_FORM ?>">
<table width="100%">
  <tr>
    <td width="70%">
      <?php // filter checkbox ?>
      <?php foreach ($INFO_FILTER as $info_filter) { ?>
      <input type='checkbox'
             name='<?php echo NAME_FILTER_FIELD_MASK ?>'
             value='<?php echo $info_filter[FILTER_INDEX_VALUE] ?>'
             <?php echo $info_filter[FILTER_INDEX_CHECKED] ?>
      >
      <?php echo $info_filter[FILTER_INDEX_LABEL] ?>
      <?php } ?>
      &nbsp;
      <?php // 'refresh' button ?>
      <a href="#"
         class="<?php echo CSS_CLASS_BUTTON_REFRESH . " "
                           . JQUI_CSS_GROUP_BUTTON  . " "
                           . JQUI_CSS_CLASS_BUTTON_LEFT ?>"
      >
        <span class="ui-icon ui-icon-refresh"></span>
        <?php echo LBL_FILTER_REFRESH ?>
      </a>
    </td>
    <td width="30%" align="right">
      <?php // 'rows per page' select box ?>
      <?php
      // start select box
      $select = "<select class='" . CSS_CLASS_SELECT_ROWSPP . "'
                         name='" . NAME_FILTER_FIELD_ROWSPP . "'
                 >";
      // create select box option
      foreach ($VALS_ROWSPP as $val_rowspp) {
        $select .= "<option value='" . $val_rowspp . "'"
                          . ((DEF_ROWSPP == $val_rowspp) ? "selected" : "")
                 . ">"
                 . $val_rowspp
                 . "</option>";
      }
      // end select box
      $select .= "</select>";
      // embed select box in label
      ?>
      <?php echo str_replace(SEARCH_ROWSPP, $select, LBL_ROWSPP) ?>
    </td>
  </tr>
</table>
</form>
